public class text2 {
    public class Solution {
        public int GetNumberOfK(int [] array , int k) {

            return search(array,k+1.0/2)-search(array,k-1.0/2);


        }
        public int search(int[]array,double b)
        {
            int left=0;
            int right=array.length-1;
            while(left<=right)
            {
                int mid=(left+right)/2;
                if(array[mid]>b)
                {
                    right=mid-1;
                }
                else if(array[mid]<b)
                {
                    left=mid+1;
                }
            }
            return left;

        }
    }
    public static void main(String[] args) {
      Thread[] thread=new Thread[20];
      int i=0;
      for(i=0;i<20;i++)
      {
          final int a=i;
          thread[i]=new Thread(new Runnable() {
              @Override
              public void run() {
                  System.out.println(a);

              }
          });
      }
      for(Thread t:thread)
      {
          t.start();

      }
      for(Thread m:thread)
      {
          try {
              m.join();
          } catch (InterruptedException e) {
              throw new RuntimeException(e);
          }
      }
        System.out.println("ok");
    }
}
